package org.example.thread.testSequence;

import java.util.concurrent.CompletableFuture;

/**
 * @author liyishan
 * @date 2024/7/16 15:08
 * @apiNote
 */

public class TestSequence03 {

    public static void main(String[] args) {
        Thread t1 = new Thread(() -> System.out.println("线程1"), "线程1");
        Thread t2 = new Thread(() -> System.out.println("线程2"), "线程2");
        Thread t3 = new Thread(() -> System.out.println("线程3"));

        CompletableFuture.runAsync(() -> t1.start())
                .thenRun(() -> t2.start())
                .thenRun(() -> t3.start());
    }
}
